package wang.unclecat.databinding.slice;

import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.aafwk.content.Operation;
import wang.unclecat.databinding.ResourceTable;

public class MainAbilitySlice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);
        findComponentById(ResourceTable.Id_btn1)
                .setClickedListener((v) -> present(new HelloSlice(), new Intent()));

        findComponentById(ResourceTable.Id_btn2)
                .setClickedListener((v) -> {
                    startAbility(new Intent().setElementName(getBundleName(), "wang.unclecat.dataability.MainAbility"));
                });
    }

}
